import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/special_list/job_plan_details_entity.dart';

JobPlanDetailsEntity $JobPlanDetailsEntityFromJson(Map<String, dynamic> json) {
  final JobPlanDetailsEntity jobPlanDetailsEntity = JobPlanDetailsEntity();
  final String? applyDepartmentId = jsonConvert.convert<String>(json['applyDepartmentId']);
  if (applyDepartmentId != null) {
    jobPlanDetailsEntity.applyDepartmentId = applyDepartmentId;
  }
  final String? applyDepartmentName = jsonConvert.convert<String>(json['applyDepartmentName']);
  if (applyDepartmentName != null) {
    jobPlanDetailsEntity.applyDepartmentName = applyDepartmentName;
  }
  final String? applyUserId = jsonConvert.convert<String>(json['applyUserId']);
  if (applyUserId != null) {
    jobPlanDetailsEntity.applyUserId = applyUserId;
  }
  final String? applyUserName = jsonConvert.convert<String>(json['applyUserName']);
  if (applyUserName != null) {
    jobPlanDetailsEntity.applyUserName = applyUserName;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    jobPlanDetailsEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    jobPlanDetailsEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    jobPlanDetailsEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    jobPlanDetailsEntity.createDate = createDate;
  }
  final String? departmentId = jsonConvert.convert<String>(json['departmentId']);
  if (departmentId != null) {
    jobPlanDetailsEntity.departmentId = departmentId;
  }
  final String? departmentName = jsonConvert.convert<String>(json['departmentName']);
  if (departmentName != null) {
    jobPlanDetailsEntity.departmentName = departmentName;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    jobPlanDetailsEntity.id = id;
  }
  final int? identity = jsonConvert.convert<int>(json['identity']);
  if (identity != null) {
    jobPlanDetailsEntity.identity = identity;
  }
  final String? identityUserId = jsonConvert.convert<String>(json['identityUserId']);
  if (identityUserId != null) {
    jobPlanDetailsEntity.identityUserId = identityUserId;
  }
  final String? identityUserName = jsonConvert.convert<String>(json['identityUserName']);
  if (identityUserName != null) {
    jobPlanDetailsEntity.identityUserName = identityUserName;
  }
  final double? latitude = jsonConvert.convert<double>(json['latitude']);
  if (latitude != null) {
    jobPlanDetailsEntity.latitude = latitude;
  }
  final double? longitude = jsonConvert.convert<double>(json['longitude']);
  if (longitude != null) {
    jobPlanDetailsEntity.longitude = longitude;
  }
  final String? planEndDate = jsonConvert.convert<String>(json['planEndDate']);
  if (planEndDate != null) {
    jobPlanDetailsEntity.planEndDate = planEndDate;
  }
  final String? planStartDate = jsonConvert.convert<String>(json['planStartDate']);
  if (planStartDate != null) {
    jobPlanDetailsEntity.planStartDate = planStartDate;
  }
  final String? ticketAddress = jsonConvert.convert<String>(json['ticketAddress']);
  if (ticketAddress != null) {
    jobPlanDetailsEntity.ticketAddress = ticketAddress;
  }
  final String? ticketContent = jsonConvert.convert<String>(json['ticketContent']);
  if (ticketContent != null) {
    jobPlanDetailsEntity.ticketContent = ticketContent;
  }
  final List<String>? ticketIdentityId = (json['ticketIdentityId'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (ticketIdentityId != null) {
    jobPlanDetailsEntity.ticketIdentityId = ticketIdentityId;
  }
  final String? ticketName = jsonConvert.convert<String>(json['ticketName']);
  if (ticketName != null) {
    jobPlanDetailsEntity.ticketName = ticketName;
  }
  final String? ticketNo = jsonConvert.convert<String>(json['ticketNo']);
  if (ticketNo != null) {
    jobPlanDetailsEntity.ticketNo = ticketNo;
  }
  final String? ticketSource = jsonConvert.convert<String>(json['ticketSource']);
  if (ticketSource != null) {
    jobPlanDetailsEntity.ticketSource = ticketSource;
  }
  final List<String>? ticketToolId = (json['ticketToolId'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (ticketToolId != null) {
    jobPlanDetailsEntity.ticketToolId = ticketToolId;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    jobPlanDetailsEntity.updateBy = updateBy;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    jobPlanDetailsEntity.updateDate = updateDate;
  }
  return jobPlanDetailsEntity;
}

Map<String, dynamic> $JobPlanDetailsEntityToJson(JobPlanDetailsEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['applyDepartmentId'] = entity.applyDepartmentId;
  data['applyDepartmentName'] = entity.applyDepartmentName;
  data['applyUserId'] = entity.applyUserId;
  data['applyUserName'] = entity.applyUserName;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['departmentId'] = entity.departmentId;
  data['departmentName'] = entity.departmentName;
  data['id'] = entity.id;
  data['identity'] = entity.identity;
  data['identityUserId'] = entity.identityUserId;
  data['identityUserName'] = entity.identityUserName;
  data['latitude'] = entity.latitude;
  data['longitude'] = entity.longitude;
  data['planEndDate'] = entity.planEndDate;
  data['planStartDate'] = entity.planStartDate;
  data['ticketAddress'] = entity.ticketAddress;
  data['ticketContent'] = entity.ticketContent;
  data['ticketIdentityId'] = entity.ticketIdentityId;
  data['ticketName'] = entity.ticketName;
  data['ticketNo'] = entity.ticketNo;
  data['ticketSource'] = entity.ticketSource;
  data['ticketToolId'] = entity.ticketToolId;
  data['updateBy'] = entity.updateBy;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension JobPlanDetailsEntityExtension on JobPlanDetailsEntity {
  JobPlanDetailsEntity copyWith({
    String? applyDepartmentId,
    String? applyDepartmentName,
    String? applyUserId,
    String? applyUserName,
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? departmentId,
    String? departmentName,
    String? id,
    int? identity,
    String? identityUserId,
    String? identityUserName,
    double? latitude,
    double? longitude,
    String? planEndDate,
    String? planStartDate,
    String? ticketAddress,
    String? ticketContent,
    List<String>? ticketIdentityId,
    String? ticketName,
    String? ticketNo,
    String? ticketSource,
    List<String>? ticketToolId,
    String? updateBy,
    String? updateDate,
  }) {
    return JobPlanDetailsEntity()
      ..applyDepartmentId = applyDepartmentId ?? this.applyDepartmentId
      ..applyDepartmentName = applyDepartmentName ?? this.applyDepartmentName
      ..applyUserId = applyUserId ?? this.applyUserId
      ..applyUserName = applyUserName ?? this.applyUserName
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..departmentId = departmentId ?? this.departmentId
      ..departmentName = departmentName ?? this.departmentName
      ..id = id ?? this.id
      ..identity = identity ?? this.identity
      ..identityUserId = identityUserId ?? this.identityUserId
      ..identityUserName = identityUserName ?? this.identityUserName
      ..latitude = latitude ?? this.latitude
      ..longitude = longitude ?? this.longitude
      ..planEndDate = planEndDate ?? this.planEndDate
      ..planStartDate = planStartDate ?? this.planStartDate
      ..ticketAddress = ticketAddress ?? this.ticketAddress
      ..ticketContent = ticketContent ?? this.ticketContent
      ..ticketIdentityId = ticketIdentityId ?? this.ticketIdentityId
      ..ticketName = ticketName ?? this.ticketName
      ..ticketNo = ticketNo ?? this.ticketNo
      ..ticketSource = ticketSource ?? this.ticketSource
      ..ticketToolId = ticketToolId ?? this.ticketToolId
      ..updateBy = updateBy ?? this.updateBy
      ..updateDate = updateDate ?? this.updateDate;
  }
}
